package Service.Impl;

import Dao.CheckRecordDao;
import Model.CheckRecord;
import Model.ExportFlyCheck;
import Model.Staff;
import Service.CheckRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class CheckRecordServiceImpl implements CheckRecordService {
    @Autowired
    private CheckRecordDao checkRecordDao;//创建记录对象接口mapper
    /**
     * 根据护工ID查询护工信息
     * @return
     */
    @Override
    public Staff selectHgDetail(Integer hg_id) {
        return checkRecordDao.selectHgDetail(hg_id);
    }

    /**
     * 导出飞行检查记录
     * @return
     */
    @Override
    public List<ExportFlyCheck> exportCheckList() {
        return checkRecordDao.exportCheckList();//导出飞行检查记录
    }

    /**
     * 分页显示所有记录
     * @return
     */
    @Override
    public List<CheckRecord> getCheckList(){

        return checkRecordDao.getCheckList();//调用所有记录显示

    }

    /**
     *
     * 条件查询记录显示
     * */
    @Override
    public List<CheckRecord> selectCheckList(CheckRecord selectrecord) {

        return checkRecordDao.selectCheckList(selectrecord);
    }

    /**
     *
     * 新增记录
     *
     */
    @Override
    public void addrecord(CheckRecord newrecord) {

        checkRecordDao.addrecord(newrecord);
        // return newCheckDao.addrecord(record);
    }

    /**
     *
     * 修改记录
     *
     */
    @Override
    public void updaterecord(Integer recordId,CheckRecord newrecord) {

        checkRecordDao.updaterecordById(recordId,newrecord);
        // return newCheckDao.addrecord(record);
    }
    /**
     *
     * 删除记录
     *
     */
    @Override
    public void deleterecord(Integer recordId) {

        checkRecordDao.deleterecordById(recordId);
        // return newCheckDao.addrecord(record);
    }
}
